Draw Sprite

Format: draw_sprite resource:RN with register_mark:R flags:S layer layer:N
Description: Draws a sprite using resource resource, using as sources of data the registers starting from register_mark. Flags is a string which is _ for “no flags”, or contains the letters d, h, or s. Layer is which of 4 layers to draw it on. In order, the registers used are: - x position - y position - (option with d) data index to start at - (option with s) scaling along x - (option with s) scaling along y - width of the sprite - (option with h) height of the sprite A sprite is drawn from a resource. Each number in the resource contains 4 pixels, as each pixel is a 4-bit color index.
Cycles: 5
Example: draw_sprite 0x100 with r0 dhs layer 0. In this example, register r0 contains the x position to draw it at, r1 contains the y position, r2 contains the data index to start at, r3 the scaling along x, r4 the scaling along y, r5 the width of the sprite, and r6 the height of the sprite. draw_sprite 0x100 with r1 s layer 0. In this example, r1 contains the x position, r2 the y position, r3 the scaling along x, r4 the scaling along y, and r5 the width of the sprite.
See also: Draw Rectangle, Set Pixel